<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for RSA.class.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file RSA.class.php</h1>
<p>Documentation is available at <a href="../DomBase/_libs---DomBase---RSA.class.php.html">RSA.class.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">*&nbsp;v.1.3&nbsp;[2&nbsp;Sep&nbsp;2002]</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">*&nbsp;Rivest/Shamir/Adelman&nbsp;(RSA)&nbsp;compatible&nbsp;functions</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">*&nbsp;to&nbsp;generate&nbsp;keys&nbsp;and&nbsp;encode/decode&nbsp;plaintext&nbsp;messages.</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">*&nbsp;Plaintext&nbsp;must&nbsp;contain&nbsp;only&nbsp;ASCII(32)&nbsp;-&nbsp;ASCII(126)&nbsp;characters.</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">*&nbsp;Send&nbsp;questions&nbsp;and&nbsp;suggestions&nbsp;to&nbsp;Ilya&nbsp;Rudev&nbsp;&lt;www&nbsp;&lt;at&gt;&nbsp;polar-lights&nbsp;&lt;dot&gt;&nbsp;com&gt;&nbsp;(Polar&nbsp;Lights&nbsp;Labs)</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">*&nbsp;most&nbsp;part&nbsp;of&nbsp;code&nbsp;ported&nbsp;from&nbsp;different</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">*&nbsp;C++,&nbsp;&nbsp;JS&nbsp;and&nbsp;Flash</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">*&nbsp;RSA&nbsp;examples&nbsp;found&nbsp;in&nbsp;books&nbsp;and&nbsp;in&nbsp;the&nbsp;net&nbsp;:)</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">*&nbsp;supplied&nbsp;with&nbsp;Hacker&nbsp;Hunter&nbsp;authentication&nbsp;system.</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">*&nbsp;http://www.polar-lights.com/hackerhunter/</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">*&nbsp;It&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,&nbsp;&nbsp;but</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">*&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">*&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">*&nbsp;See&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">*&nbsp;With&nbsp;a&nbsp;great&nbsp;thanks&nbsp;to:</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">*&nbsp;Glenn&nbsp;Haecker&nbsp;&lt;ghaecker&nbsp;&lt;at&gt;&nbsp;idworld&nbsp;&lt;dot&gt;&nbsp;net&gt;</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">*&nbsp;Segey&nbsp;Semenov&nbsp;&lt;sergei2002&nbsp;&lt;at&gt;&nbsp;mail&nbsp;&lt;dot&gt;&nbsp;ru&gt;</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">*&nbsp;Suivan&nbsp;&lt;ssuuii&nbsp;&lt;at&gt;&nbsp;gmx&nbsp;&lt;dot&gt;&nbsp;net&gt;</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">*&nbsp;SAMPLE:</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">echo&quot;&lt;i&gt;Keys:&lt;/i&gt;&lt;br&gt;&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">$keys&nbsp;=&nbsp;generate_keys&nbsp;(1);&nbsp;</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">//or&nbsp;just&nbsp;</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">//$keys&nbsp;=&nbsp;RSA::generate_keys();&nbsp;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">$message=&quot;&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">for&nbsp;($i=32;$i&lt;127;$i++)&nbsp;$message.=chr($i);&nbsp;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">$encoded&nbsp;=&nbsp;RSA::encrypt(&nbsp;$message,&nbsp;&nbsp;$keys[1],&nbsp;&nbsp;$keys[0]);&nbsp;</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">$decoded&nbsp;=&nbsp;RSA::decrypt(&nbsp;$encoded,&nbsp;&nbsp;$keys[2],&nbsp;&nbsp;$keys[0]);&nbsp;</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">echo&nbsp;&quot;&lt;pre&gt;&lt;br&gt;&lt;i&gt;Test&nbsp;ASCII(32)&nbsp;-&nbsp;ASCII(126):&lt;/i&gt;\n&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">echo&nbsp;&quot;Message:&nbsp;&lt;b&gt;$message&lt;/b&gt;\n&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">echo&nbsp;&quot;Encoded:&nbsp;&lt;b&gt;$encoded&lt;/b&gt;\n&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">echo&nbsp;&quot;Decoded:&nbsp;&lt;b&gt;$decoded&lt;/b&gt;\n&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">echo&nbsp;&quot;Success:&nbsp;&quot;.(($decoded&nbsp;==&nbsp;$message)&nbsp;?&nbsp;&quot;True&quot;&nbsp;:&nbsp;&quot;False&quot;).&quot;&lt;/pre&gt;\n&quot;;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-key">class&nbsp;</span><a href="../DomBase/RSA.html">RSA</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Prime&nbsp;numbers&nbsp;table&nbsp;</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;570&nbsp;prime&nbsp;numbers&nbsp;(Array&nbsp;can&nbsp;not&nbsp;be&nbsp;be&nbsp;enlarged)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;4507,&nbsp;4513&nbsp;is&nbsp;the&nbsp;smallest&nbsp;and&nbsp;9521,&nbsp;9533&nbsp;is&nbsp;the&nbsp;largest&nbsp;pair&nbsp;</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Still&nbsp;have&nbsp;no&nbsp;time&nbsp;to&nbsp;find&nbsp;why&nbsp;9521,&nbsp;9533&nbsp;is&nbsp;the&nbsp;largest&nbsp;-&nbsp;sorry&nbsp;:)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$primes&nbsp;</span>=&nbsp;<span class="src-key">array&nbsp;</span><span class="src-sym">(</span><span class="src-num">4507</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4513</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4517</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4519</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4523</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4547</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4549</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4561</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4567</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4583</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4591</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4597</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">4603</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4621</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4637</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4639</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4643</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4649</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4651</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4657</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4663</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4673</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4679</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4691</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4703</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4721</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4723</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4729</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4733</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4751</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">4759</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4783</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4787</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4789</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4793</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4799</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4801</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4813</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4817</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4831</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4861</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4871</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4877</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4889</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4903</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4909</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4919</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4931</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">4933</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4937</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4943</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4951</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4957</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4967</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4969</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4973</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4987</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4993</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">4999</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5003</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5009</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5011</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5021</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5023</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5039</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5051</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5059</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5077</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5081</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5087</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5099</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5101</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5107</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5113</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5119</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5147</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5153</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5167</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5171</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5179</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5189</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5197</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5209</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5227</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5231</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5233</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5237</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5261</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5273</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5279</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5281</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5297</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5303</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5309</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5323</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5333</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5347</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5351</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5381</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5387</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5393</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5399</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a59"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5407</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5413</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5417</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5419</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5431</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5437</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5441</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5443</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5449</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5471</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5477</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5479</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5483</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5501</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5503</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5507</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5519</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5521</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a60"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5527</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5531</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5557</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5563</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5569</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5573</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5581</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5591</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5623</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5639</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5641</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5647</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5651</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5653</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5657</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5659</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5669</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5683</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5689</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5693</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5701</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5711</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5717</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5737</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5741</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5743</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5749</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5779</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5783</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5791</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5801</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5807</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5813</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5821</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5827</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5839</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5843</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5849</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5851</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5857</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5861</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5867</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5869</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5879</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5881</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5897</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5903</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5923</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5927</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5939</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5953</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5981</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">5987</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6007</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6011</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6029</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6037</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6043</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6047</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6053</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6067</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6073</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6079</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6089</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6091</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6101</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6113</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6121</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6131</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6133</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6143</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6151</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6163</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6173</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6197</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6199</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6203</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6211</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6217</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6221</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6229</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6247</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6257</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6263</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6269</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6271</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6277</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6287</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6299</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6301</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6311</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6317</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6323</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6329</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6337</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6343</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6353</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6359</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6361</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6367</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6373</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6379</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6389</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6397</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6421</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6427</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6449</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6451</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6469</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6473</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6481</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6491</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6521</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6529</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6547</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6551</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6553</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6563</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6569</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6571</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6577</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6581</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6599</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6607</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6619</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6637</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6653</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6659</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6661</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6673</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6679</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6689</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6691</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6701</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6703</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6709</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6719</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6733</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6737</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6761</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6763</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6779</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6781</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6791</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6793</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6803</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6823</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6827</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6829</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6833</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6841</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6857</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6863</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6869</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6871</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6883</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6899</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6907</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6911</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6917</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6947</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6949</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6959</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6961</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6967</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6971</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6977</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6983</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6991</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">6997</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7001</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7013</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7019</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7027</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7039</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7043</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7057</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7069</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7079</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7103</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7109</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7121</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7127</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7129</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7151</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7159</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7177</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7187</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7193</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7207</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7211</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7213</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7219</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7229</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7237</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7243</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7247</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7253</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7283</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7297</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7307</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7309</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7321</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7331</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7333</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7349</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7351</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7369</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7393</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7411</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7417</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7433</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7451</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7457</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7459</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7477</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7481</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7487</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7489</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7499</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7507</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7517</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7523</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7529</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7537</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7541</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7547</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7549</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7559</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7561</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7573</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7577</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7583</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7589</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7591</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7603</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7607</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7621</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7639</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7643</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7649</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7669</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7673</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7681</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7687</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7691</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7699</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7703</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7717</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7723</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7727</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7741</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7753</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7757</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7759</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7789</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7793</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7817</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7823</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7829</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7841</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7853</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7867</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7873</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7877</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7879</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7883</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7901</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7907</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7919</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7927</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7933</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7937</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7949</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7951</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7963</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">7993</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8009</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8011</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8017</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8039</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8053</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8059</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8069</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8081</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8087</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8089</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8093</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">8101</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8111</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8117</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8123</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8147</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8161</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8167</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8171</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8179</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8191</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8209</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8219</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8221</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8231</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8233</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8237</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8243</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8263</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">8269</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8273</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8287</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8291</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8293</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8297</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8311</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8317</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8329</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8353</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8363</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8369</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8377</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8387</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8389</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8419</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8423</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8429</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">8431</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8443</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8447</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8461</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8467</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8501</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8513</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8521</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8527</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8537</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8539</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8543</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8563</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8573</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8581</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8597</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8599</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8609</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a79"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">8623</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8627</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8629</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8641</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8647</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8663</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8669</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8677</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8681</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8689</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8693</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8699</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8707</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8713</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8719</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8731</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8737</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8741</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">8747</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8753</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8761</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8779</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8783</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8803</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8807</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8819</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8821</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8831</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8837</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8839</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8849</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8861</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8863</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8867</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8887</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8893</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">8923</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8929</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8933</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8941</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8951</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8963</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8969</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8971</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">8999</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9001</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9007</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9011</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9013</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9029</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9041</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9043</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9049</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9059</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">9067</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9091</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9103</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9109</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9127</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9133</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9137</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9151</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9157</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9161</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9173</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9181</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9187</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9199</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9203</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9209</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9221</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9227</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">9239</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9241</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9257</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9277</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9281</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9283</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9293</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9311</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9319</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9323</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9337</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9341</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9343</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9349</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9371</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9377</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9391</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9397</span><span class="src-sym">,&nbsp;</span></div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">9403</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9413</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9419</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9421</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9431</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9433</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9437</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9439</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9461</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9463</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9467</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9473</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9479</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9491</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9497</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9511</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9521</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">9533</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$maxprimes&nbsp;</span>=&nbsp;<span class="src-num">570</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*Function&nbsp;for&nbsp;generating&nbsp;keys.&nbsp;Return&nbsp;array&nbsp;where&nbsp;</span></div></li>
<li><div class="src-line"><a name="a91"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$array[0]&nbsp;-&gt;&nbsp;modulo&nbsp;N&nbsp;</span></div></li>
<li><div class="src-line"><a name="a92"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$array[1]&nbsp;-&gt;&nbsp;public&nbsp;key&nbsp;E&nbsp;</span></div></li>
<li><div class="src-line"><a name="a93"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$array[2]&nbsp;-&gt;&nbsp;private&nbsp;key&nbsp;D&nbsp;</span></div></li>
<li><div class="src-line"><a name="a94"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;Public&nbsp;key&nbsp;pair&nbsp;is&nbsp;N&nbsp;and&nbsp;E&nbsp;</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;Private&nbsp;key&nbsp;pair&nbsp;is&nbsp;N&nbsp;and&nbsp;D&nbsp;</span></div></li>
<li><div class="src-line"><a name="a96"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomBase/RSA.html#methodgenerateKeys">generateKeys</a><span class="src-sym">(&nbsp;</span><span class="src-var">$show_debug</span>=<span class="src-num">0&nbsp;</span><span class="src-sym">)</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/mt_srand">mt_srand</a><span class="src-sym">(</span>(double)<a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-sym">)</span>*<span class="src-num">1000000</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$primes</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$primes</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$maxprimes&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$maxprimes</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)&nbsp;</span>||&nbsp;<span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$d</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*finding&nbsp;2&nbsp;small&nbsp;prime&nbsp;numbers&nbsp;$p&nbsp;and&nbsp;$q&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$p&nbsp;and&nbsp;$q&nbsp;must&nbsp;be&nbsp;different*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$p&nbsp;</span>=&nbsp;<span class="src-var">$primes</span><span class="src-sym">[</span><span class="src-id">mt_rand</span><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$maxprimes</span><span class="src-sym">)</span><span class="src-sym">]</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$q</span><span class="src-sym">)&nbsp;</span>||&nbsp;<span class="src-sym">(</span><span class="src-var">$p</span>==<span class="src-var">$q</span><span class="src-sym">))&nbsp;</span><span class="src-var">$q&nbsp;</span>=&nbsp;<span class="src-var">$primes</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$maxprimes</span><span class="src-sym">)</span><span class="src-sym">]</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//second&nbsp;part&nbsp;of&nbsp;public&nbsp;and&nbsp;private&nbsp;pairs&nbsp;-&nbsp;N&nbsp;</span></div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$n&nbsp;</span>=&nbsp;<span class="src-var">$p</span>*<span class="src-var">$q</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$pi&nbsp;(we&nbsp;need&nbsp;it&nbsp;to&nbsp;calculate&nbsp;D&nbsp;and&nbsp;E)&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pi&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$p&nbsp;</span>-&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-sym">(</span><span class="src-var">$q&nbsp;</span>-&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a113"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Public&nbsp;key&nbsp;&nbsp;E&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$e&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">tofindE</span><span class="src-sym">(</span><span class="src-var">$pi</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$p</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$q</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Private&nbsp;key&nbsp;D&nbsp;</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$d&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">extend</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">,&nbsp;</span><span class="src-var">$pi</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a120"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keys&nbsp;</span>=&nbsp;<span class="src-key">array&nbsp;</span><span class="src-sym">(</span><span class="src-var">$n</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$e</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$d</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$show_debug</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-str">&quot;</span><span class="src-str">P&nbsp;=&nbsp;<span class="src-var">$p</span>&lt;br&gt;Q&nbsp;=&nbsp;<span class="src-var">$q</span>&lt;br&gt;&lt;b&gt;N&nbsp;=&nbsp;<span class="src-var">$n</span>&lt;/b&gt;&nbsp;-&nbsp;modulo&lt;br&gt;PI&nbsp;=&nbsp;<span class="src-var">$pi</span>&lt;br&gt;&lt;b&gt;E&nbsp;=&nbsp;<span class="src-var">$e</span>&lt;/b&gt;&nbsp;-&nbsp;public&nbsp;key&lt;br&gt;&lt;b&gt;D&nbsp;=&nbsp;<span class="src-var">$d</span>&lt;/b&gt;&nbsp;-&nbsp;private&nbsp;key&lt;p&gt;</span><span class="src-str">&quot;</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$keys</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;modulus&nbsp;function&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">mo&nbsp;</span><span class="src-sym">(</span><span class="src-var">$g</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$l</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$g&nbsp;</span>-&nbsp;<span class="src-sym">(</span><span class="src-var">$l&nbsp;</span>*&nbsp;<a href="http://www.php.net/floor">floor</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$g</span>/<span class="src-var">$l</span><span class="src-sym">))</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a134"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Standard&nbsp;method&nbsp;of&nbsp;calculating&nbsp;D&nbsp;</span></div></li>
<li><div class="src-line"><a name="a135"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;D&nbsp;=&nbsp;E-1&nbsp;(mod&nbsp;N)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a136"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It's&nbsp;presumed&nbsp;D&nbsp;will&nbsp;be&nbsp;found&nbsp;in&nbsp;less&nbsp;then&nbsp;16&nbsp;iterations&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a138"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">extend&nbsp;</span><span class="src-sym">(</span><span class="src-var">$Ee</span><span class="src-sym">,&nbsp;</span><span class="src-var">$Epi</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$u1&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a140"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$u2&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a141"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$u3&nbsp;</span>=&nbsp;<span class="src-var">$Epi</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$v1&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$v2&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$v3&nbsp;</span>=&nbsp;<span class="src-var">$Ee</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-var">$v3&nbsp;</span>!=&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$qq&nbsp;</span>=&nbsp;<a href="http://www.php.net/floor">floor</a><span class="src-sym">(</span><span class="src-var">$u3</span>/<span class="src-var">$v3</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$t1&nbsp;</span>=&nbsp;<span class="src-var">$u1&nbsp;</span>-&nbsp;<span class="src-var">$qq&nbsp;</span>*&nbsp;<span class="src-var">$v1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$t2&nbsp;</span>=&nbsp;<span class="src-var">$u2&nbsp;</span>-&nbsp;<span class="src-var">$qq&nbsp;</span>*&nbsp;<span class="src-var">$v2</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$t3&nbsp;</span>=&nbsp;<span class="src-var">$u3&nbsp;</span>-&nbsp;<span class="src-var">$qq&nbsp;</span>*&nbsp;<span class="src-var">$v3</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$u1&nbsp;</span>=&nbsp;<span class="src-var">$v1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$u2&nbsp;</span>=&nbsp;<span class="src-var">$v2</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$u3&nbsp;</span>=&nbsp;<span class="src-var">$v3</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$v1&nbsp;</span>=&nbsp;<span class="src-var">$t1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a154"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$v2&nbsp;</span>=&nbsp;<span class="src-var">$t2</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a155"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$v3&nbsp;</span>=&nbsp;<span class="src-var">$t3</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a156"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$z&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$uu&nbsp;</span>=&nbsp;<span class="src-var">$u1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$vv&nbsp;</span>=&nbsp;<span class="src-var">$u2</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$vv&nbsp;</span>&lt;&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$inverse&nbsp;</span>=&nbsp;<span class="src-var">$vv&nbsp;</span>+&nbsp;<span class="src-var">$Epi</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$inverse&nbsp;</span>=&nbsp;<span class="src-var">$vv</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$inverse</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;This&nbsp;function&nbsp;return&nbsp;Greatest&nbsp;Common&nbsp;Divisor&nbsp;for&nbsp;$e&nbsp;and&nbsp;$pi&nbsp;numbers&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">GCD</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">,&nbsp;</span><span class="src-var">$pi</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$y&nbsp;</span>=&nbsp;<span class="src-var">$e</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$x&nbsp;</span>=&nbsp;<span class="src-var">$pi</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-var">$y&nbsp;</span>!=&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$w&nbsp;</span>=&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">mo</span><span class="src-sym">(</span><span class="src-var">$x&nbsp;</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$y</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$x&nbsp;</span>=&nbsp;<span class="src-var">$y</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$y&nbsp;</span>=&nbsp;<span class="src-var">$w</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$x</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*function&nbsp;for&nbsp;calculating&nbsp;E&nbsp;under&nbsp;conditions:&nbsp;</span></div></li>
<li><div class="src-line"><a name="a182"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;GCD(N,&nbsp;E)&nbsp;=&nbsp;1&nbsp;and&nbsp;1&lt;E&lt;N&nbsp;</span></div></li>
<li><div class="src-line"><a name="a183"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;each&nbsp;test&nbsp;E&nbsp;is&nbsp;prime,&nbsp;&nbsp;there&nbsp;will&nbsp;be&nbsp;much&nbsp;less&nbsp;loops&nbsp;in&nbsp;that&nbsp;fuction&nbsp;</span></div></li>
<li><div class="src-line"><a name="a184"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;smaller&nbsp;E&nbsp;means&nbsp;less&nbsp;JS&nbsp;calculations&nbsp;on&nbsp;client&nbsp;side&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a186"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Calculating&nbsp;E&nbsp;under&nbsp;conditions:&nbsp;</span></div></li>
<li><div class="src-line"><a name="a187"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;GCD(N,&nbsp;E)&nbsp;=&nbsp;1&nbsp;and&nbsp;1&lt;E&lt;N&nbsp;</span></div></li>
<li><div class="src-line"><a name="a188"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;E&nbsp;is&nbsp;prime,&nbsp;&nbsp;there&nbsp;will&nbsp;be&nbsp;fewer&nbsp;loops&nbsp;in&nbsp;the&nbsp;function.&nbsp;</span></div></li>
<li><div class="src-line"><a name="a189"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Smaller&nbsp;E&nbsp;also&nbsp;means&nbsp;reduced&nbsp;JS&nbsp;calculations&nbsp;on&nbsp;client&nbsp;side.&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a190"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">tofindE</span><span class="src-sym">(</span><span class="src-var">$pi</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$primes</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$primes</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$maxprimes&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$maxprimes</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$great&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cc&nbsp;</span>=&nbsp;<span class="src-id">mt_rand&nbsp;</span><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-var">$maxprimes</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$startcc&nbsp;</span>=&nbsp;<span class="src-var">$cc</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-var">$cc&nbsp;</span>&gt;=&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$se&nbsp;</span>=&nbsp;<span class="src-var">$primes</span><span class="src-sym">[</span><span class="src-var">$cc</span><span class="src-sym">]</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$great&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">GCD</span><span class="src-sym">(</span><span class="src-var">$se</span><span class="src-sym">,&nbsp;</span><span class="src-var">$pi</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cc</span>--<span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$great&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;</span><span class="src-key">break</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$great&nbsp;</span>==&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cc&nbsp;</span>=&nbsp;<span class="src-var">$startcc&nbsp;</span>+&nbsp;<span class="src-num">1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a206"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-var">$cc&nbsp;</span>&lt;=&nbsp;<span class="src-var">$maxprimes</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$se&nbsp;</span>=&nbsp;<span class="src-var">$primes</span><span class="src-sym">[</span><span class="src-var">$cc</span><span class="src-sym">]</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a208"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$great&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">GCD</span><span class="src-sym">(</span><span class="src-var">$se</span><span class="src-sym">,&nbsp;</span><span class="src-var">$pi</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a209"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cc</span>++<span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a210"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$great&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;</span><span class="src-key">break</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a211"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a212"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a213"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$se</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a214"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a215"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a217"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;ENCRYPT&nbsp;function&nbsp;returns&nbsp;</span></div></li>
<li><div class="src-line"><a name="a218"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*,&nbsp;&nbsp;X&nbsp;=&nbsp;M^E&nbsp;(mod&nbsp;N)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a219"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Please&nbsp;check&nbsp;http://www.ge.kochi-ct.ac.jp/cgi-bin-takagi/calcmodp&nbsp;</span></div></li>
<li><div class="src-line"><a name="a220"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;and&nbsp;Flash5&nbsp;RSA&nbsp;.fla&nbsp;by&nbsp;R.Vijay&nbsp;&lt;rveejay0&nbsp;&lt;at&gt;&nbsp;hotmail&nbsp;&lt;dot&gt;&nbsp;com&gt;&nbsp;at&nbsp;</span></div></li>
<li><div class="src-line"><a name="a221"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;http://www.digitalillusion.co.in/lab/rsaencyp.htm&nbsp;</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;is&nbsp;one&nbsp;of&nbsp;the&nbsp;simplest&nbsp;examples&nbsp;for&nbsp;binary&nbsp;RSA&nbsp;calculations&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Each&nbsp;letter&nbsp;in&nbsp;the&nbsp;message&nbsp;is&nbsp;represented&nbsp;as&nbsp;its&nbsp;ASCII&nbsp;code&nbsp;number&nbsp;-&nbsp;30&nbsp;</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;3&nbsp;letters&nbsp;in&nbsp;each&nbsp;block&nbsp;with&nbsp;1&nbsp;in&nbsp;the&nbsp;beginning&nbsp;and&nbsp;end.&nbsp;</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;For&nbsp;example&nbsp;string&nbsp;</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*,&nbsp;&nbsp;AAA&nbsp;</span></div></li>
<li><div class="src-line"><a name="a228"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;become&nbsp;</span></div></li>
<li><div class="src-line"><a name="a229"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*,&nbsp;&nbsp;13535351&nbsp;(A&nbsp;=&nbsp;ASCII&nbsp;65-30&nbsp;=&nbsp;35)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a230"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;we&nbsp;can&nbsp;build&nbsp;these&nbsp;blocks&nbsp;because&nbsp;the&nbsp;smalest&nbsp;prime&nbsp;available&nbsp;is&nbsp;4507&nbsp;</span></div></li>
<li><div class="src-line"><a name="a231"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*,&nbsp;&nbsp;4507^2&nbsp;=&nbsp;20313049&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a232"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;means&nbsp;that&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a233"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*,&nbsp;&nbsp;1.&nbsp;Modulo&nbsp;N&nbsp;will&nbsp;always&nbsp;be&nbsp;&lt;&nbsp;19999991&nbsp;</span></div></li>
<li><div class="src-line"><a name="a234"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*,&nbsp;&nbsp;2.&nbsp;Letters&nbsp;&gt;&nbsp;ASCII&nbsp;128&nbsp;must&nbsp;not&nbsp;occur&nbsp;in&nbsp;plain&nbsp;text&nbsp;message&nbsp;</span></div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a237"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomBase/RSA.html#methodencrypt">encrypt</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$m</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$e</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$n</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a238"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$asci&nbsp;</span>=&nbsp;<span class="src-key">array&nbsp;</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a239"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$i</span>=<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>&lt;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$m</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>+=<span class="src-num">3</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a240"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tmpasci</span>=<span class="src-str">&quot;1&quot;</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a241"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$h</span>=<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$h</span>&lt;<span class="src-num">3</span><span class="src-sym">;&nbsp;</span><span class="src-var">$h</span>++<span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a242"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$i</span>+<span class="src-var">$h&nbsp;</span>&lt;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$m</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a243"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tmpstr&nbsp;</span>=&nbsp;<a href="http://www.php.net/ord">ord</a>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$m</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$i</span>+<span class="src-var">$h</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">1</span><span class="src-sym">))&nbsp;</span>-&nbsp;<span class="src-num">30</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a244"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$tmpstr</span><span class="src-sym">)&nbsp;</span>&lt;&nbsp;<span class="src-num">2</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a245"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tmpstr&nbsp;</span>=<span class="src-str">&quot;0&quot;</span>.<span class="src-var">$tmpstr</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a250"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tmpasci&nbsp;</span>.=<span class="src-var">$tmpstr</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$asci</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$tmpasci</span>.<span class="src-str">&quot;1&quot;</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a255"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Each&nbsp;number&nbsp;is&nbsp;then&nbsp;encrypted&nbsp;using&nbsp;the&nbsp;RSA&nbsp;formula:&nbsp;block&nbsp;^E&nbsp;mod&nbsp;N&nbsp;</span></div></li>
<li><div class="src-line"><a name="a256"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$k</span>=<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$k</span>&lt;&nbsp;<a href="http://www.php.net/count">count</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$asci</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$k</span>++<span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$resultmod&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">powmod</span><span class="src-sym">(</span><span class="src-var">$asci</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$e</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$n</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a258"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$coded&nbsp;</span>.=&nbsp;<span class="src-var">$resultmod</span>.<span class="src-str">&quot;&nbsp;&quot;</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$coded</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*Russian&nbsp;Peasant&nbsp;method&nbsp;for&nbsp;exponentiation&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">powmod&nbsp;</span><span class="src-sym">(</span><span class="src-var">$base</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$exp</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$modulus</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$accum&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$basepow2&nbsp;</span>=&nbsp;<span class="src-var">$base</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">((</span><span class="src-var">$exp&nbsp;</span>&gt;&gt;&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&gt;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a269"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(((</span><span class="src-var">$exp&nbsp;</span>&gt;&gt;&nbsp;<span class="src-var">$i</span><span class="src-sym">)&nbsp;</span><span class="src-sym">&amp;&nbsp;</span><span class="src-num">1</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a270"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$accum&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">mo</span><span class="src-sym">((</span><span class="src-var">$accum&nbsp;</span>*&nbsp;<span class="src-var">$basepow2</span><span class="src-sym">)&nbsp;</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$modulus</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a271"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$basepow2&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">mo</span><span class="src-sym">((</span><span class="src-var">$basepow2&nbsp;</span>*&nbsp;<span class="src-var">$basepow2</span><span class="src-sym">)&nbsp;</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$modulus</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>++<span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$accum</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a276"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a277"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a278"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a279"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;ENCRYPT&nbsp;function&nbsp;returns&nbsp;</span></div></li>
<li><div class="src-line"><a name="a280"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;M&nbsp;=&nbsp;X^D&nbsp;(mod&nbsp;N)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a281"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/&nbsp;</span></div></li>
<li><div class="src-line"><a name="a282"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomBase/RSA.html#methoddecrypt">decrypt</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$c</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$d</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$n</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a283"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Strip&nbsp;the&nbsp;blank&nbsp;spaces&nbsp;from&nbsp;the&nbsp;ecrypted&nbsp;text&nbsp;and&nbsp;store&nbsp;it&nbsp;in&nbsp;an&nbsp;array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a284"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$decryptarray&nbsp;</span>=&nbsp;<a href="http://www.php.net/split">split</a><span class="src-sym">(</span><span class="src-str">&quot;&nbsp;&quot;</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$c</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$u</span>=<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$u</span>&lt;<a href="http://www.php.net/count">count</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$decryptarray</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$u</span>++<span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$decryptarray</span><span class="src-sym">[</span><span class="src-var">$u</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-str">&quot;&quot;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_splice">array_splice</a><span class="src-sym">(</span><span class="src-var">$decryptarray</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$u</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Each&nbsp;number&nbsp;is&nbsp;then&nbsp;decrypted&nbsp;using&nbsp;the&nbsp;RSA&nbsp;formula:&nbsp;block&nbsp;^D&nbsp;mod&nbsp;N&nbsp;</span></div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$u</span>=<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$u</span>&lt;&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$decryptarray</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$u</span>++<span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$resultmod&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">powmod</span><span class="src-sym">(</span><span class="src-var">$decryptarray</span><span class="src-sym">[</span><span class="src-var">$u</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$d</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$n</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//remove&nbsp;leading&nbsp;and&nbsp;trailing&nbsp;'1'&nbsp;digits&nbsp;</span></div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$deencrypt</span>.=&nbsp;<a href="http://www.php.net/substr">substr</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$resultmod</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$resultmod</span><span class="src-sym">)</span>-<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Each&nbsp;ASCII&nbsp;code&nbsp;number&nbsp;+&nbsp;30&nbsp;in&nbsp;the&nbsp;message&nbsp;is&nbsp;represented&nbsp;as&nbsp;its&nbsp;letter&nbsp;</span></div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$u</span>=<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$u</span>&lt;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$deencrypt</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$u</span>+=<span class="src-num">2</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$resultd&nbsp;</span>.=&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$deencrypt</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-var">$u</span><span class="src-sym">,&nbsp;&nbsp;</span><span class="src-num">2</span><span class="src-sym">)&nbsp;</span>+&nbsp;<span class="src-num">30</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$resultd</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a302"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a303"></a><span class="src-php">?&gt;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:15:09 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>